<%@ page language="java" import="java.util.*,com.zhangzy.qm.entity.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">    
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/demo.css" type="text/css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/css/zTreeStyle/zTreeStyle.css" type="text/css">
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.3.2.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.ztree.core-3.0.js"></script>

	<SCRIPT LANGUAGE="JavaScript">
		<!--
		var webContext = "${pageContext.request.contextPath}";
		
		var setting = {
			data: {
				simpleData: {
					enable: true
				}
			}
		};

		var zNodes =[
			{ id:1, pId:0, name:"根目录", open:true},
			{ id:2, pId:1, name:"专辑管理",open:true},
			{ id:3, pId:2, name:"添加专辑",url:webContext+"/toAddAblu.action" ,target:"mainFrame"},
			{ id:4, pId:2, name:"专辑管理",url:webContext+"/ablumIndex.action",target:"mainFrame"},
			{ id:5, pId:1, name:"试题管理",open:true},
			{ id:6, pId:5, name:"添加试题",url:webContext+"/toAddTopic.action",target:"mainFrame"},
			{ id:7, pId:5, name:"试题管理",url:webContext+"/topicIndex.action",target:"mainFrame"},
			{ id:8, pId:1, name:"发布管理",open:true},
			{ id:9, pId:8, name:"推送专辑",url:webContext+"/pushDataIndex.action",target:"mainFrame"}
	
		];

		$(document).ready(function(){
			$.fn.zTree.init($("#treeDemo"), setting, zNodes);
		});
		
		function logout(){
			$.ajax({
				type : "post",
				url : webContext+"/logout.action",
				dataType : "json",	
				success: function(data){    
					if(data.success=='true'){	
						window.parent.location.href=webContext+"/toLogin.action";
					}else{
						alert("安全退出失败，请联系管理员！");
					}									
				},
				error : function(XMLHttpRequest, textStatus, errorThrown){
				}
				});
		}
		//-->
	</SCRIPT>
</head>  
<%
User user = (User)request.getSession().getAttribute("user");
request.setAttribute("chineseName",user.getChineseName());
%>
<body style="margin-left: 6px;">
<div style="font-size: 16px; font-weight: bold;text-align: center; margin-top: 8px;margin-bottom: 8px;"><jsp:include page="title.jsp"></jsp:include></div>

<div style="height: 20px;font-size: 12px;padding-left: 6px; ">当前用户：${chineseName}&nbsp;&nbsp;<input type="button" onclick="javascript:logout()"  value="退出" class="btn"></div>
<div id="treeDemo" class="ztree"></div>
</body></html>